package org.idea.qiyu.framework.web.controller;

import org.idea.qiyu.framework.web.model.IResponseVO;
import org.idea.qiyu.framework.web.model.MessageResponseVO;
import org.idea.qiyu.framework.web.model.ResponseData;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @Author linhao
 * @Date created in 12:08 下午 2021/8/31
 */
@RestController
@RequestMapping(value = "/do-test")
public class TestController {

    @GetMapping(value = "/test")
    public Map<String, Object> doTest(){
        Map<String,Object> res = new HashMap<>();
        res.put("name","xiaoming");
        res.put("age","30");
        return res;
    }

    @GetMapping(value = "/test-str")
    public String testString(){
        System.out.println("testString");
        return "success";
    }

    @GetMapping(value = "/do-job")
    public IResponseVO doJob(){
        System.out.println("job");
        return MessageResponseVO.success("success-test");
    }

    @GetMapping(value = "/do-void")
    public void doVoid(){
        System.out.println("do-void");
    }
}
